Skip to content

Conversation

@Strift
Copy link
Collaborator

@Strift Strift commented Sep 18, 2025

Pull Request

What does this PR do?

  • Update memory limit for phpstan

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

Summary by CodeRabbit

  • Chores
    • Updated development script configuration to run static analysis with a defined memory limit, improving reliability and consistency during developer workflows and CI runs. This helps prevent out-of-memory failures when analyzing larger codebases. No changes to user-facing functionality or behavior.

@coderabbitai
Copy link

coderabbitai bot commented Sep 18, 2025

Walkthrough

Updates composer.json’s phpstan script to include a memory limit flag, changing from "./vendor/bin/phpstan" to "./vendor/bin/phpstan --memory-limit=512M".

Changes

Cohort / File(s) Summary
Build & Tooling Scripts
composer.json
Modified phpstan script to append --memory-limit=512M.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • brunoocasali

Poem

A nibble of RAM for Stan to chew,
512M—now errors fewer and few.
I hop through scripts with whiskers bright,
Composer sings, the checks run right.
Tip-tap paws, CI in view—
Another leap, another review! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR updates composer.json's phpstan script to run phpstan with an added memory limit, so the title "Update composer command to run phpstan" accurately reflects the primary change and is concise enough for a quick history scan.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/fix-phpstan-issues

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b8de313 and 69a080f.

📒 Files selected for processing (1)
  • composer.json (1 hunks)
🔇 Additional comments (1)
composer.json (1)

72-72: Use @php for portability; set memory via -d memory_limit.

  • Change:
-        "phpstan": "./vendor/bin/phpstan --memory-limit=512M",
+        "phpstan": "@php -d memory_limit=512M vendor/bin/phpstan",
  • Verification: running the supplied commands failed with "sh: 1: ./vendor/bin/phpstan: not found" (exit code 127). Install dependencies (composer install) or ensure vendor/bin/phpstan exists and re-run to confirm the memory flag is recognized.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Strift Strift force-pushed the chore/fix-phpstan-issues branch from 40a20da to 69a080f Compare September 18, 2025 06:14
@Strift Strift added the maintenance Anything related to maintenance (CI, tests, refactoring...) label Sep 18, 2025
@Strift Strift changed the title Fix phpstan issues Update composer command to run phpstan Sep 18, 2025
@Strift Strift marked this pull request as ready for review September 18, 2025 06:21
@Strift Strift requested a review from norkunas September 18, 2025 06:21
@norkunas
Copy link
Collaborator

What's the point of this?

@Strift
Copy link
Collaborator Author

Strift commented Sep 18, 2025

I often run into memory issues when running composer phpstan locally.

This PR addresses the same memory limit issue fixed in #778. That other PR only focused on the Docker compose environment, though.

I can circumvent it by running ./vendor/bin/phpstan --memory-limit=512M instead, but I thought it would be better if the composer script contained the correct arguments.

What do you think?

@norkunas
Copy link
Collaborator

norkunas commented Sep 18, 2025

But that depends on the environment. If i have much memory, why it should limit and run slower? 🙂

in #778 it was increased, so not the same

@Strift
Copy link
Collaborator Author

Strift commented Sep 18, 2025

Thanks for the clarification! Indeed, everyone should configure it manually if needed

@Strift Strift closed this Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Anything related to maintenance (CI, tests, refactoring...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants